# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html


class JwcSpiderPipeline(object):
    def process_item(self, item, spider):
        path = "F:/cs_jcw_spidwer/JWC_SPIDER/PDFS/"
        file = item['name'] + '__' + item['pdf_id'] + '.pdf'  # pdf保存名字
        path += file

        with open(path, 'wb') as fp:
            fp.write(item["pdf_content"])

        return item
